package io;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Demo2 {

	public static void main(String[] args) throws Exception{
		List<String> banWords = new ArrayList<String>();
	    List<String> auditWords = new ArrayList<String>();
	    List<String> replaceWords = new ArrayList<String>();
	    String file = Demo2.class.getClassLoader().getResource("disu.txt").getFile();
	    String file2 = Demo2.class.getResource("zhengfu.txt").getFile();
	    System.out.println(file);
	    System.out.println(file2);
		File f = new File(file2);
		BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(f),"gb2312"));
		String line = null;
		while((line=reader.readLine())!=null){
			
			String str[] = line.split("\\|");
			if(str.length!=2){
				continue;
			}
			String word = str[0].trim();
			String level = str[1].trim();
			if("1".equals(level)){
				banWords.add(word);
			}
			if("2".equals(level)){
				auditWords.add(word);
			}
			if("3".equals(level)){
				replaceWords.add(word);
			}
		}
		for(String s :banWords){
			System.out.println(s);
		}
		System.out.println(banWords.size());
		reader.close();
	}

}
